package cn.itsource.basic.util.message;

import cn.hutool.core.util.RandomUtil;
import cn.hutool.http.HttpUtil;
import org.springframework.stereotype.Component;

/**
 * 交给spring管理
 */
@Component
public class SendMobileMessageService {


    public void send(String phone) {
        String code = RandomUtil.randomNumbers(4);
        System.out.println("我的验证码----------------" + code);
        //1.java利用hutool发get请求
        HttpUtil.get("http://utf8.api.smschinese.cn/?Uid=yanxinming&Key=D74CEE71C0BE50DECDBC36D0395DABF0&smsMob=" + phone + "&smsText=验证码:" + code);


    }
}
